package com.hyh.eblog.controller;


import cn.hutool.core.collection.ListUtil;
import com.hyh.eblog.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.hyh.eblog.controller.BaseController;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Summerday
 * @since 2020-10-19
 */
//@RequestMapping("/comment")
@Controller
public class CommentController extends BaseController {


    @GetMapping("test")
    public String test(HttpServletRequest request){
        List<User> users = new LinkedList<>();
        for(int i = 0; i < 10; i ++){
            User user = new User();
            user.setId((long)i);
            user.setUsername("name = " + i);
            users.add(user);
        }
        request.setAttribute("users",users);

        return "test";
    }
}
